package com.multidisplay.po;


import com.fasterxml.jackson.annotation.JsonProperty;
import com.multidisplay.pojo.AddUser;

import lombok.Data;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
public class User {
    private int id;     //系统标识用户id
    @JsonProperty("uId")
    private String uId;     //用户账号
    private String password;     //用户密码
    private String name;    //用户姓名
    private String email;      //用户邮箱
    private String phone;   //联系方式

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)    //自动填充
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date createtime;

    public User() {
    }

    public User(int id, String uId, String password, String name, String email, String phone, Date createtime) {
        this.id = id;
        this.uId = uId;
        this.password = password;
        this.name = name;
        this.email = email;
        this.phone = phone;
        this.createtime = createtime;
    }

    public User(AddUser addUser){
        uId=addUser.getuId();
        password=addUser.getPassword();
        name=addUser.getName();
        email=addUser.getEmail();
        phone=addUser.getPhone();
        createtime=addUser.getCreatetime();
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", uId='" + uId + '\'' +
                ", password='" + password + '\'' +
                ", name='" + name + '\'' +
                ", email='" + email + '\'' +
                ", phone='" + phone + '\'' +
                ", createtime=" + createtime +
                '}';
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getuId() {
        return uId;
    }

    public void setuId(String uId) {
        this.uId = uId;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }
}
